<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>样式继承</title>
    <style>
        #d1 {
            height: 600px;
            background-color: gray;
            padding: 50px;
        }
        #d2 {
            height: 400px;
            padding: 50px;
            background-color: orange;
        }
        #d3 {
            height: 200px;
            background-color: green;
        }
    </style>
</head>
<!--body默认margin 8px-->
<body style="margin: 0">
<img src="../../images/样式继承.png" width="500px" >
<div id="d1">
    <div id="d2">
        <div id="d3">

        </div>
    </div>
</div>
</body>
</html>